# import arcpy
# import math
# #输出的采样点csv文件
# outputPointFile = r"D:\xmData\point_wgs.csv"
# #上一步处理好的道路
# input_road =  r"D:\xmData\xiamen.gdb\road"
# #三个中间数据
# densified_road = r"D:\xmData\xiamen.gdb\roadDen7"
# out_road = r"D:\xmData\xiamen.gdb\roadoutroad7"
# out_points = "xmPoint2"
# #复制文件，确保输入数据不免，以免出问题后无法重新处理
# arcpy.CopyFeatures_management(input_road, densified_road)
# sr = arcpy.Describe(densified_road).SpatialReference
#
# arcpy.Densify_edit(densified_road, "DISTANCE", "40 Meters")
# arcpy.SplitLine_management(densified_road, out_road)
#
# # arcpy.env.workspace=r"D:\xmData\xiamen.gdb"
# print(arcpy.env.workspace,sr)
# #创建点要素,字段分别为路段的ID、X、Y
# arcpy.CreateFeatureclass_management(arcpy.env.workspace, out_points, 'POINT', spatial_reference=sr)
# arcpy.AddField_management(out_points, "roadFID", "DOUBLE", 9)
# arcpy.AddField_management(out_points, "pointX", "DOUBLE", 9)
# arcpy.AddField_management(out_points, "pointY", "DOUBLE", 9)
# cursor_point = arcpy.da.InsertCursor(out_points, ['SHAPE@',"pointX","pointY","roadFID"])
#
# # 需要读取的属性
# fields_array = ["SHAPE@","OBJECTID"]
# for row in arcpy.da.SearchCursor(out_road, fields_array):
#     line_geo = row[0]   # 线要素
#     seg_id =  row[1]
#     # 第一个点和最后一个点
#     fp = line_geo.firstPoint
#     lp = line_geo.lastPoint
#     cursor_point.insertRow([fp,float(fp.X),float(fp.Y),seg_id])
#     cursor_point.insertRow([lp,float(lp.X),float(lp.Y),seg_id])
# arcpy.AddXY_management(out_points)
#
# def WebMercator2lonLatx(x):
#     lon = x/20037508.34*180;
#
#     return lon
# def WebMercator2lonLaty(y):
#
#     lat = y/20037508.34*180;
#     lat= 180/math.pi*(2*math.atan(math.exp(lat*math.pi/180))-math.pi/2);
#     return lat
# # 根据位置去除相同点,
# fields = ["Shape"]
# arcpy.DeleteIdentical_management(out_points, fields)
#
# f = open(outputPointFile,'w')
# f.write("ID,pointX,pointY,direction\n")
# for row in arcpy.da.SearchCursor(out_points, ["OBJECTID","POINT_X","POINT_Y"]):
#     f.write("{0},{1},{2}\n".format(row[0],WebMercator2lonLatx(row[1]),WebMercator2lonLaty(row[2])))
# f.close()
import numpy

value = numpy.zeros(int(10))
# 统计value
for rv in result:
    if rv[0] > 10 and rv[0] < 20:
         value[0]+=1